﻿@model Lienhe
@{
    ViewBag.Title = "Liên Hệ";
}

<div class="panel panel-default" style="margin-left: -20px; margin-right: -20px;">
    <div class="panel-heading" style="font-size:16px">Nhập Thông tin</div></div>
<div class="panel panel-default" style="margin-left: -20px; margin-right: -20px;margin-top:-15px;">
    <div class="row">
        <div class="col-md-8">

            @using (Html.BeginForm("Index", "Lienhe", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
            {

                @Html.ValidationSummary(true)
                <div> @ViewBag.xem </div>
                <div class="form-group">
                    @*@Html.Label("Id", new { @class = "col-md-5 control-label" })*@
                    <div class="col-md-7">
                        @Html.HiddenFor(m => m.Id, new { @class = "form-control" })
                        @Html.ValidationMessageFor(m => m.Id)
                    </div>
                </div>
                <div class="form-group">
                    @Html.Label("Tên của bạn", new { @class = "col-md-5 control-label" })
                    <div class="col-md-7">
                        @Html.TextBoxFor(m => m.Tennguoilienhe, new { @class = "form-control" })
                        @Html.ValidationMessageFor(m => m.Tennguoilienhe)
                    </div>
                </div>
                <div class="form-group">
                    @Html.Label("Địa chỉ Email của bạn", new { @class = "col-md-5 control-label" })
                    <div class="col-md-7">
                        @Html.TextBoxFor(m => m.Diachiemail, new { @class = "form-control" })
                        @Html.ValidationMessageFor(m => m.Diachiemail)
                    </div>
                </div>
                <div class="form-group">
                    @Html.Label("Tiêu đề", new { @class = "col-md-5 control-label" })
                    <div class="col-md-7">
                        @Html.TextBoxFor(m => m.Tieude, new { @class = "form-control" })
                        @Html.ValidationMessageFor(m => m.Tieude)
                    </div>
                </div>
                <div class="form-group">
                    @Html.Label("Nội dung", new { @class = "col-md-5 control-label" })
                    <div class="col-md-7">
                        @Html.TextAreaFor(m => m.Noidung, new { @class = "form-control" })
                        @Html.ValidationMessageFor(m => m.Noidung)
                    </div>
                </div>

                <div class="form-group container">
                    @Html.Label("        ", new { @class = "col-md-5 control-label" })
                    <div class="col-md-7">
                        <input type="submit" value="    Gửi    " onclick="form.action='/Lienhe/Them'" class="btn btn-default" />


                    </div>
                </div>


            }

        </div>

    </div>
</div>
    @*<table>
        <tr>
            <th>Id</th>
            <th>Tên người liên hệ</th>
            <th>Địa chỉ Email</th>
            <th>Tiêu đề</th>
            <th>Nội dung</th>
        </tr>
        @foreach (Lienhe l in ViewBag.lienhe)
        {
            <tr>
                <td>@l.Id</td>
                <td>@l.Tennguoilienhe</td>
                <td>@l.Diachiemail</td>
                <td>@l.Tieude</td>
                <td>@l.Noidung</td>
            </tr>
        }
    </table>*@

    @section Scripts {
        @Scripts.Render("~/bundles/jqueryval")
    }

